﻿Public Class ViewParametrerDeroulement

    Private Sub Estimer_CRT_MenuItem_Click(sender As Object, e As Windows.RoutedEventArgs)
        Dim datamanager As New DataManager
        datamanager.Recalculer_Table_Deroule_Historique_Crt()
    End Sub

    Private Sub BtSetCRT_Click(sender As Object, e As Windows.RoutedEventArgs) Handles BtSetCRT.Click
        Dim data As ViewModelParametrerDeroulement = DataContext
        Dim datamanager As New DataManager

        For Each drv As DataRowView In HistoCrtDgrid.SelectedItems

            Dim drow As DataModel.PmtDataset.Deroule_HistoCrtRow = drv.Row

            Dim r = datamanager.Dataset.Deroule.FindByGroupeCode_GarantieDeroule(drow.Groupe, drow.Code_Garantie, drow.Deroule)

            If r Is Nothing Then
                datamanager.Dataset.Deroule.AddDerouleRow(drow.Groupe, drow.Code_Garantie, drow.Deroule, drow.Taux_Deroule_Prime, drow.Taux_Deroule_Sinistre, drow.CS_sur_PR)
            Else
                r.Taux_Deroule_Prime = drow.Taux_Deroule_Prime
                r.Taux_Deroule_Sinistre = drow.Taux_Deroule_Sinistre
                r.CS_sur_PR = drow.CS_sur_PR
            End If
        Next
    End Sub

    Private Sub Reinitialiser_Table_MenuItem_Click(sender As Object, e As Windows.RoutedEventArgs)
        Dim datamanager As New DataManager


    End Sub

    Private Sub BtSetCBP_Click(sender As Object, e As Windows.RoutedEventArgs) Handles BtSetCBP.Click
        Dim data As ViewModelParametrerDeroulement = DataContext
        Dim datamanager As New DataManager

        For Each drv As DataRowView In CbpDgrid.SelectedItems

        Next
    End Sub
End Class
